// 跳转

let go = (url)=>{
	const app = require('@/pages.json')
	let tabberlist =   app.default.tabBar.list
	tabberlist = tabberlist.map( item =>'/' + item.pagePath )
	if(tabberlist.includes(url)){
		uni.switchTab({
			url
		})
	}else{
		uni.navigateTo({
			url
		})
	}
}



const requploud=(tempFilePaths)=> {
				return new Promise((ok, no) => {
					uni.showLoading({
						title: '上传中'
					})
					uni.uploadFile({
						url: 'http://api.quanjiu.net/estate/api/upload/add', //仅为示例，非真实的接口地址
						filePath: tempFilePaths,
						name: 'file',
						header: {
							Authorization: uni.getStorageSync('token')
						},
						formData: {
							'user': 'test'
						},
						success: (uploadFileRes) => {
							let data = JSON.parse(uploadFileRes.data)
							ok(data.data)
						},
						complete: () => {
							uni.hideLoading()
						}
					});

				})

			}

export default {go,requploud}